package com.xia.juan.work.domain;

import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

import java.util.Objects;

/**
 * @author wang
 */
@Data
public class ExcelDataEntity {

    @ExcelProperty(index = 0)
    private String serialNo;

    @ExcelProperty(index = 1)
    private String className;

    @ExcelProperty(index = 2)
    private String studentNumber;

    @ExcelProperty(index = 3)
    private String studentName;

    @ExcelProperty(index = 4)
    private String dailyScore;

    @ExcelProperty(index = 5)
    private String examScore;

    @ExcelProperty(index = 6)
    private String finalScore;

    @ExcelProperty(index = 7)
    private String remark;

    @ExcelProperty(index = 8)
    private String disparity;

    @ExcelProperty(index = 9)
    private String job1;

    @ExcelProperty(index = 10)
    private String job2;

    @ExcelProperty(index = 11)
    private String job3;

    @ExcelProperty(index = 12)
    private String job4;

    @ExcelProperty(index = 13)
    private String experiment;

    public String[] convertValueToArray() {
        return new String[]{serialNo, className, studentNumber, studentName,
                StrUtil.isEmpty(dailyScore) ? "0" : dailyScore, StrUtil.isEmpty(examScore) ? "0" : examScore,
                StrUtil.isEmpty(finalScore) ? "0" : finalScore, Objects.isNull(remark) ? "" : remark, disparity, job1,
                job2, job3, job4, experiment
        };
    }

}
